package attr

type Attribute int

const (
	//----------基础-----------

	Str  Attribute = 1 //力量
	Dex  Attribute = 2 //敏捷
	Vit  Attribute = 3 //体力
	Eng  Attribute = 4 //精力
	Hp   Attribute = 5 //生命
	Mana Attribute = 6 //法力值
	/*------------攻击属性-----------*/

	MinDamage            Attribute = 11 //最小伤害值
	MaxDamage            Attribute = 12 //最大伤害值
	Att                  Attribute = 13 //准确率
	DoubleDamageRatio    Attribute = 14 //暴击率
	AttackSpeed          Attribute = 15 //攻击速度
	AttackSpeedGear      Attribute = 15 //攻击速度挡位
	ChanceOfCrushingBlow Attribute = 16 //压碎攻击的几率
	ChanceOfOpenWounds   Attribute = 17 //撕开伤口的几率%
	TargetSpeedReduced   Attribute = 18 //目标减速
	TargetDefense        Attribute = 19 //减少目标防御%
	IgnoreTargetDefense  Attribute = 20 //无视目标防御

	//------------法术-------------

	CastSpeed        Attribute = 21 //施法速度
	CastSpeedGear    Attribute = 22 //施法速度挡位
	MagicDamageBonus Attribute = 23 //法术伤害加成
	//---------防御------------

	Def                           Attribute = 23 //防御值
	Block                         Attribute = 24 //格挡率
	DamageReduced                                //伤害减少
	DefVsMissile                                 //增加对近战的防御
	DefVsMelee                                   //增加对远程攻击的防御
	FireResistance                Attribute = 25 //%增加火抗的百分比
	LightningResistance           Attribute = 26 //%增加电抗的百分比
	ColdResistance                Attribute = 27 //%增加冰抗的百分比
	PoisonResistance              Attribute = 28 //%增加毒抗的百分比
	MagicResistance               Attribute = 29 //%增加抗魔法百分比
	DrResistance                  Attribute = 30 //%增加物理抗百分比
	FireDamageReduced             Attribute = 31 //火焰伤害减少
	LightningDamageReduced        Attribute = 32 //雷电伤害减少
	ColdDamageReduced             Attribute = 33 //冰霜伤害减少
	PoisonDamageReduced           Attribute = 34 //毒素伤害减少
	MagicDamageReduced            Attribute = 35 //魔法伤害减少
	DrDamageReduced               Attribute = 36 //物理伤害减少
	StunResistance                Attribute = 37 //眩晕抵抗%
	FreezeResistance              Attribute = 38 //冻结抵抗%
	AttackerTakesDamageResistance Attribute = 39 //反弹抵抗%
	RegenerateHp                  Attribute = 41 //每轮生命回复
	RegenerateMana                Attribute = 42 //法力再生%
	PoisonLength                  Attribute = 43 //目标中毒的持续时间
	ColdLength                    Attribute = 44 //冻结目标的时间
	//----------附加伤害-------------

	FireDamage      //增加火焰伤害
	MaxFireDamage   //增加火焰伤害最大值
	ColdDamage      //增加寒冷伤害
	MaxColdDamage   //增加寒冷伤害最大值
	LightningDamage //增加闪电伤害
	MaxLightningDmg //增加闪电伤害最大值
	PoisonDamage    //增加毒伤害
	MaxPoisonDmg    //增加毒伤害最大值
	MagicDamage     //增加魔法伤害
	MaxMagicDamage  //增加魔法伤害最大值
	//---------------伤害吸收--------

	FireAbsorbsRatio      //火焰吸收%
	FireAbsorbs           //火焰吸收
	ColdAbsorbsRatio      //冰冷吸收%
	ColdAbsorbs           //冰冷吸收
	LightningAbsorbsRatio //闪电吸收%
	LightningAbsorbs      //闪电吸收
	PoisonAbsorbsRatio    //毒素吸收%
	PoisonAbsorbs         //毒素吸收
	MagicAbsorbsRatio     //魔法吸收%
	MagicAbsorbs          //魔法吸收
	//---------辅助--------

	LifeStolenPerHitMax   //偷取生命
	ManaStolenPerHitMax   //偷取法力
	AttackerTakesDamageOf //反伤
	LightRadius           //增加光照范围
	Requirements          //%物品对基本属性的需求
	CannotBeFrozen        //不会被冻结
	StunLength            //使目标眩晕的时间
)

const (
	BaseHp     Attribute = iota + 101 //基础生命值
	BaseMana                          //基础法力值
	BaseDef                           //基础防御值
	BaseAtt                           //基础准确率
	BaseDamage                        //基础最伤害值
	BaseBlock                         //基础格挡率
)

const (
	ExtHp        Attribute = 201 //额外生命
	ExtMana      Attribute = 202 //额外法力
	ExtDef       Attribute = 203 //额外防御
	ExtAtt       Attribute = 204 //额外准确率
	ExtMinDamage Attribute = 205 //额外最小伤害值
	ExtMaxDamage Attribute = 206 //额外最大伤害值
	ExtBlock     Attribute = 207 //额外格挡率
)

const (
	ExtHpRatio           Attribute = 301 //额外生命百分比
	ExtManaRatio         Attribute = 302 //额外法力百分比
	EnhanceDamage        Attribute = 303 //伤害增加百分比
	ExtWeaponDamageRatio Attribute = 304 //额外特定武器增伤百分比（适合的武器）
	EnhanceDefence       Attribute = 305 //防御增加百分比
	BonusToAttackRating  Attribute = 306 //额外准确率百分比%
)

const (
	MaxDamageResistance = 75 //抗性上限
)

// 一级属性
func GetFirstLevelAttr() []Attribute {
	return []Attribute{Str, Dex, Vit, Eng}
}

// 是否为一级属性
func IsFirstLevelAttr(a Attribute) bool {
	if a == Str || a == Dex || a == Vit || a == Eng {
		return true
	}
	return false
}
